n = eval(input("Input n for how many people play the game:"))
k = eval(input("Input k for which one to quit the game:"))
lst = [x + 1 for x in range(n)]


def josephus(lst, k):
    k -= 1
    idx = k
    turn = 1
    while len(lst) > 1:
        lst.pop(idx)
        print(lst)
        idx = (idx + k) % len(lst)
    print('winner: ', lst[0])


josephus(lst, k)
